import request from '../utils/request'

import mokeAxios from "@/utils/mock"

export interface CateGoryModel {
    bannerList: null,
    bannerUrl: string,
    categoryType: number,
    extra: null,
    frontDesc: string,
    frontName: string,
    frontNameIcon: null,
    iconUrl: string,
    id: number,
    imgUrl: string,
    level: string,
    name: string,
    showIndex: number,
    subCateList: [],
    superCategoryId: number,
    type: number,
    wapBannerUrl: string,
    wapExpandPicTargetUrl: null
}

// tab栏接口限定
export interface CateGory {
  bannerList: null,
  bannerUrl: string,
  categoryType: number,
  extra: null,
  frontDesc: string,
  frontName: string,
  frontNameIcon: null,
  iconUrl: string,
  id: number,
  imgUrl: string,
  level: string,
  name: string,
  showIndex: number,
  subCateList: [],
  superCategoryId: number,
  type: number,
  wapBannerUrl: string,
  wapExpandPicTargetUrl: null
}
export type CateGoryList = CateGory[]


// 轮播图
export interface Focus {
  expireTime: number
  extra: Extra
  id: number
  name: string
  onlineTime: number
  originSchemeUrl: string
  picUrl: string
  targetUrl: string
}
export interface Extra {
  alg_personalized: string
  crmUserGroupId: string
  crmUserGroupName: string
  itemFrom: number
  materialContentFrom: number
  materialId: string
  materialName: string
  materialType: string
  rcmdSort: boolean
  resourcesId: number
  taskId: string
  taskType: number
}
export type FocusList = Focus[]

// 广告
export interface Advert {
  icon: string
  schemeUrl: string
  desc: string
}
export type AdvertList = Advert[]

// 宫格分类的接口
export interface ClassificationModel {
  picUrl: string,
  schemeUrl: string,
  text: string,
  textColor: string
}
export type ClassificationListModel = ClassificationModel[]

// 爆款里的小轮播接口
export interface Floor {
  colorNum: number
  id: number
  picUrl: string
  pieceNum: number
  pieceUnitDesc: string
  primarySkuPreSellPrice: number
  primarySkuPreSellStatus: number
  schemeUrl: string
}
export type FloorList = Floor[]

// 爆款直降图片
export interface PopularItemModel {
  primarySkuPreSellStatus: number,
  picUrl: string,
  pieceUnitDesc: string,
  pieceNum: number,
  colorNum: number,
  schemeUrl: string,
  primarySkuPreSellPrice: number,
  id: number
}
// 爆款直降的接口
export interface PopularModel {
  schemeUrl: string,
  picUrl: string,
  itemList: PopularItemModel[]
}

// 新人专享的数据接口
export interface IndexActivityModel {
  activityPrice: string
  backgroundUrl: string
  originPrice: string
  picUrl: string
  showPicUrl: string
  subTitle: string
  tag: string
  targetUrl: string
  title: string
}
export type IndexActivityModuleModel = IndexActivityModel[]

// 类目热销榜相关数据的接口
export interface CategoryHotSellModel {
  picUrl: string,
  categoryName: string,
  targetUrl: string,
  showPicUrl: string
}
export interface CategoryHotSellModuleModel {
  categoryList: CategoryHotSellModel[],
  title: string
}

// 穿新衣与严选的数据相关接口

export interface StyleBannerAndItemModel {
  descColor: string,
  picUrl?: string,
  picUrlList?: string[],
  titleColor: string,
  title: string,
  targetUrl: string,
  desc: string
}
export interface SceneLightShoppingGuideModel {
  styleBanner?: StyleBannerAndItemModel,
  styleItem?: StyleBannerAndItemModel
}
export type SceneLightShoppingGuideModuleModel = SceneLightShoppingGuideModel[]


export default {
  //其他频道数据
  getCategoryList() {
    return request.get(`/wy/item/list.json?timestamp=1630136511866&categoryId=1005000`)
  },
  //推荐频道数据
  getRecommendList() {
    return request.get('/wy/xhr/index.json?timestamp=1630131808529')
  },
  reqFloor(){
    return mokeAxios.get<any,any>(`/mock/Floor`)
}
}
